let counter = document.querySelector(".container");
const addCount = () => {
	let curCount = +counter.innerHTML;
	let target = +counter.getAttribute("data-target");

	if (curCount < target) {
		curCount++;
		counter.innerHTML = curCount;
        var timer = setTimeout(() => {
            addCount()
        }, 1);
    } else {
        clearTimeout(timer);
        counter.innerHTML = curCount;
    }
};

addCount()
